home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Communications Toolbox / CTB Development Resources / Staging Alerts < prev   
Encoding:
Text File  |  1995-09-26  |  2.2 KB  |  50 lines  |  [TEXT/MPS ]

  1.                                                             Author
  2.                                                             ------
  3.                                                             Alex Rosenberg
  4.                                                             
  5. If your tool choose dialog features EditText fields that have value limits, such
  6. as a field that must be a number between 1 and 32767, then you should be using
  7. staged alerts. All the tools in the Basic Connectivity Set demonstrate this.
  8.  
  9. That section of the Dialog Manager chapter in Inside Mac that you didn’t
  10. understand was trying to explain this. As the user enters invalid characters (such
  11. as a letter) into this EditText field, you call Note, Stop, or CautionAlert.
  12. Normally, this would display an alert telling the user that this field can only
  13. accept numbers. But if your ALRT resource is set up correctly, it will just beep
  14. the first one, two, or three times the user makes this same mistake. Then, every
  15. subsequent error results in the alert being displayed.
  16.  
  17. resource 'ALRT' (1000, purgeable) {
  18.     {58, 68, 162, 422},
  19.     31057,
  20.     {    /* array: 4 elements in reverse order 4, 3, 2, 1 */
  21.         OK, visible, sound1,
  22.         OK, visible, sound1,
  23.         OK, invisible, sound1,
  24.         OK, invisible, sound1
  25.     }
  26. };
  27.  
  28. This ALRT is like the one in the XMODEM Tool. The first two stages, it just beeps.
  29. The third consecutive time that Note, Stop, or CautionAlert is called with this
  30. resource ID, the dialog is actually displayed.
  31.  
  32. You can find out more about staged alerts in Inside Macintosh Volume 1, page I-409.
  33. ======================================================================
  34.  
  35.  
  36.  
  37. -------------------------------------------------------------------------------------
  38. DISCLAIMER - This paper contains hints to assist CommToolbox software developers with 
  39. their efforts at producing awesome products.  They are just hints (a form of help) 
  40. however, and are not intended to represent the only possible solution.  
  41.  
  42. It should also be noted that this paper describes current CommToolbox interface 
  43. usage and while the CTB interface could change, upwards-compatibility will remain a 
  44. focus of the CTB production team wherever possible.  Therefore the hints contained 
  45. in this document that use the changing CTB interface represent a solution that should
  46. remain viable.
  47.                         -------------------------------------
  48.                           Copyright © 1992 Apple Computer, Inc.
  49.                           All rights reserved.
  50.